import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';

/**
 * Generated class for the InputTaskPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@Component({
  selector: 'page-input-task',
  templateUrl: 'input-task.html',
})
export class InputTaskPage {

  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    let task: Task = this.navParams.get("task");
    if(task){
      this.title = task.title;
      this.status = task.status;
      this.description = task.description;
      this.objectId = task.objectId;
      this.action = '编辑';
    }
  }
  close(){
    this.viewCtrl.dismiss();
  }

  saveTask(){
    let _task : Task ={
      title: this.title,
      status: this.status,
      description: this.description,
      objectId: this.objectId,
    }
  }

}
